package com.caregiver.watch.business.data.enums;

import lombok.Getter;

/**
 * @Description: 睡眠类型
 * @Author 疆戟
 * @Date 2025/9/16 21:09
 * @Version 1.0
 */
@Getter
public enum SleepTypeEnum {

    /**
     * 3 深睡
     *
     * 4 浅睡
     *
     * 6 清醒
     *
     * 7 快速眼动
     */

    DEEP_SLEEP(3, "深睡"),
    LIGHT_SLEEP(4, "浅睡"),
    WAKE_UP(6, "清醒"),
    FAST_EYE_MOVEMENT(7, "快速眼动");


    private final Integer code;
    private final String message;


    SleepTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static SleepTypeEnum pares(Integer code) {
        for (SleepTypeEnum value : SleepTypeEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

    public static String getMessage(Integer code) {
        for (SleepTypeEnum value : SleepTypeEnum.values()) {
            if (value.code.equals(code)) {
                return value.message;
            }
        }
        return null;
    }
}
